﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using FRL.DebtChased.Repository;
using FRL.DebtChased.Silverlight.Library.RichContentService;

namespace FRL.DebtChased.Silverlight.Library
{

	/// <summary>
	/// Declaration of ReadOnlyContactPointCtrl class
	/// Display of contact point, and dial or queuing button
	/// </summary>
	public partial class ReadOnlyContactPointCtrl : UserControl
	{

		/////////////////////////////////////////////////////////////
		// Construction

		public ReadOnlyContactPointCtrl()
		{

			// Load xaml resources
			InitializeComponent();

		}

		/////////////////////////////////////////////////////////////
		// Event Handlers

		private void CallButton_Click(object sender, EventArgs e)
		{

			// Message for user
			MessageBoxes.PopupDevMessage();

		}

		private void RequestModification_Click(object sender, EventArgs e)
		{

			// Find parent control
			ReadOnlyContactDetailsCtrl parentCtrl = this.FindParent(typeof(ReadOnlyContactDetailsCtrl)) as ReadOnlyContactDetailsCtrl;

			// Request a modification for this field
			parentCtrl.RequestModification(Definitions.eDataField.Contact_Point, 0, null);

		}

		/////////////////////////////////////////////////////////////
		// Operations

		public void Set(ContactPointTransport point)
		{

			// Set controls
			tbAddress.Text = point.Address;

		}

	}

}
